## {# 翻页的代码片段,适用于 Mako 模板,需要变量: page, Paginator对象 #}
<div class="pagination pagination-centered">
    <ul class="pagination pagination-centered">

        ## <li {% if page.number == 1 %}class="disabled"{% endif %}>
        % if page.number == 1:
            <li class="disabled">
        % else:
            <li>
        % endif
            ## <a href="?page=1&{{ page.queries }}">首页</a>
            <a href="?page=1&${ page.queries }">首页</a>
        </li>

        ## {% if page.has_previous() %}
        % if page.has_previous():
            ## <li><a href="?page={{ page.previous_page_number() }}&{{ page.queries }}">上一页</a></li>
            <li><a href="?page=${ page.previous_page_number() }&${ page.queries }">上一页</a></li>
        ## {% else %}
        % else:
            <li class="disabled"><a>上一页</a></li>
        ## {% endif %}
        % endif

        <li class="disabled">
            ## <a>page {{ page.number }} of {{ page.paginator.num_pages }}</a>
            <a>page ${ page.number } of ${ page.paginator.num_pages }</a>
        </li>

        ## {% if page.has_next() %}
        % if page.has_next():
            ## <li><a href="?page={{ page.next_page_number() }}&{{ page.queries }}">下一页</a></li>
            <li><a href="?page=${ page.next_page_number() }&${ page.queries }">下一页</a></li>
        ## {% else %}
        % else:
            <li class="disabled"><a>下一页</a></li>
        ## {% endif %}
        % endif

        ## <li {% if not page.has_next() %}class="disabled"{% endif %}>
        % if not page.has_next():
            <li class="disabled">
        % else:
            <li>
        % endif
            ## <a href="?page={{ page.paginator.num_pages }}&{{ page.queries }}">尾页</a>
            <a href="?page=${ page.paginator.num_pages }&${ page.queries }">尾页</a>
        </li>

    </ul>
</div>
